/* Geometry Vertex Shader */

// Matrix Buffer
cbuffer MatrixBuffer : register(b0)
{
	row_major float4x4 World			: WORLD;
	row_major float4x4 WorldViewProj	: WORLDVIEWPROJECTION;
	row_major float4x4 View				: VIEW;
};

// Vertex Input
struct VertexInput
{
	float4 Position		: POSITION;
	float3 Normal		: NORMAL;
	float2 TexCoord		: TEXCOORD;
};

// Vertex Output
struct VertexOutput
{
	float4 Position			: SV_POSITION;
	float4 WorldPosition	: WORLDPOSITION;
	float3 Normal			: NORMAL;
	float2 TexCoord			: TEXCOORD;
};

VertexOutput main(VertexInput input)
{
	VertexOutput output = (VertexOutput)0;

	output.Position = mul(input.Position, WorldViewProj);
	output.WorldPosition = mul(input.Position, World);
	output.Normal = normalize(mul(input.Normal, (float3x3) World)) * 0.5f + 0.5f;
	output.TexCoord = input.TexCoord;

	return output;
}